<?php

include('../include/mysqli_connect.php');
$q = "SELECT count(cat_id) AS COUNT from categories";
$r = mysqli_query($dbc, $q)or die("Query {$q} loi mat roi \n<br /> Mysql Error: " . mysqli_error($dbc));
echo "<pre>";
print_r($r);
echo "<br /><br />";
if (mysqli_num_rows($r) == 1) {
    $array = array();
    $array=list($num) = mysqli_fetch_array($r);
    echo $num;
//    $array=list($num);
    echo "<pre>";
    print_r($array);
    die();
}
?>